<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>电信博雅卡</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<link rel="stylesheet" href="https://static.91haoka.cn/vant.css" />
		<script src="https://static.91haoka.cn/vue.min.js"></script>
		<script src="https://static.91haoka.cn/vantall.js"></script>
		<script src="https://static.91haoka.cn/axios.min.js"></script>

	</head>
	

	<body>
		<div id="app" style="width: 100vw;height: 100vh; background: url('./cdbg.jpg'); background-size: cover;" v-cloak>
			
			<div style="text-align: center; font-size: 16px; color: #fff; padding-top: 4rem;">全部订单</div>
			
			<div style="text-align: center; font-size: 30px; font-weight: bold; color: #fff; padding-top: 0.5rem;">{{num}}</div>
		</div>




		<script>
			var h = document.documentElement.clientWidth / 7.5 + 'px';
			document.documentElement.style.fontSize = h;

			
			new Vue({
				el: '#app',
				data: function() {
					return {
						source:"",
						shuliang:0,
						apis:"",
						num:0
					}
				},
				created() {
					
					this.source = this.getUrlParam('source')
					
					setInterval(()=>{
						this.getlist()
					},1000)
				},
				mounted() {
					
				},
				methods: {
					
					//获取url的code用
					getUrlParam: function(name) {
						var query = window.location.search.substring(1);
						var vars = query.split("&");
						for (var i = 0; i < vars.length; i++) {
							var pair = vars[i].split("=");
							if (pair[0] == name) {
								return pair[1];
							}
						}
						return (false);
					},
					getlist:function(){
						var that = this
						axios.get(`${this.apis}/api/ooinfos`)
							.then(response=> {
								this.shuliang = response.data.data
								if(this.shuliang != ''){
									let shuliang2 = 0
									this.shuliang.forEach(item=>{
										shuliang2 = shuliang2 + parseInt(item.amount) 
									})
									this.num = shuliang2
								}
								
							})
					}
					
					
				}
			});
		</script>
	</body>

</html>
